#include "Singleton.h"

#include <stdio.h>
#include <time.h>
#include <stdlib.h>

#define random(x) (rand()%x)

class TEST : public Singleton<TEST>
{
public:
	TEST();
	void fun();
private:
	int m_num;
};

TEST::TEST()
{
	m_num = random(100);
}

void TEST::fun()
{
	printf("m_num: %d \n", m_num);
}

void myFun1()
{	
	printf("In myFun1()  ");
	TEST* test = TEST::instance();
	test->fun();
}

void myFun2()
{	
	printf("In myFun2()  ");
	TEST* test = TEST::instance();
	test->fun();
}

int main()
{	
	myFun1();
	myFun2();
	getchar();
    return 0;
}

